﻿<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:TabbedWPFSample">

    <!-- CircularProgressBar -->
    <Style TargetType="{x:Type local:CircularProgressBar}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:CircularProgressBar}">
                    <Grid x:Name="LayoutRoot">
                        <Ellipse 
                            Width="{TemplateBinding Diameter}" 
                            Height="{TemplateBinding Diameter}" 
                            HorizontalAlignment="Center" 
                            VerticalAlignment="Center" 
                            Stroke="{TemplateBinding BorderBrush}" 
                            Opacity="0.5" 
                            Fill="Transparent" 
                            StrokeThickness="{TemplateBinding StrokeThickness}" />
                        <local:PiePiece 
                            CentreX="{TemplateBinding CentreX}" 
                            CentreY="{TemplateBinding CentreY}" 
                            RotationAngle="0" 
                            WedgeAngle="{TemplateBinding Angle}" 
                            Radius="{TemplateBinding Radius}" 
                            InnerRadius="{TemplateBinding InnerRadius}" 
                            Fill="{TemplateBinding Foreground}" 
                            Opacity="0.7"/>
                        <TextBlock 
                            Text="{Binding Percent, RelativeSource={RelativeSource TemplatedParent}, StringFormat=0%}" 
                            Foreground="{TemplateBinding Foreground}" 
                            FontWeight="Bold" 
                            VerticalAlignment="Center" 
                            HorizontalAlignment="Center"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>